#pragma once

#include "../umlmodel_global.h"

#include "../umlcore/JsonSerializable.h"

namespace uml {

/// <summary>
/// Point
/// A Point specifies an location in some x-y coordinate system.
/// </summary>
class UMLMODEL_EXPORT Point : public JsonSerializable {

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// x getter
    /// a real number (<= 0 or >= 0) that represents the x-coordinate of the point.
    /// </summary>
    double x() const;

    /// <summary>
    /// x setter
    /// a real number (<= 0 or >= 0) that represents the x-coordinate of the point.
    /// </summary>
    void setX(double value);

    /// <summary>
    /// y getter
    /// a real number (<= 0 or >= 0)  that represents the y-coordinate of the point.
    /// </summary>
    double y() const;

    /// <summary>
    /// y setter
    /// a real number (<= 0 or >= 0)  that represents the y-coordinate of the point.
    /// </summary>
    void setY(double value);

private: // Fields
    /// <summary>
    /// x
    /// a real number (<= 0 or >= 0) that represents the x-coordinate of the point.
    /// </summary>
    const static double x_default_;
    double x_= x_default_;

    /// <summary>
    /// y
    /// a real number (<= 0 or >= 0)  that represents the y-coordinate of the point.
    /// </summary>
    const static double y_default_;
    double y_= y_default_;

};

} // namespace uml
